﻿// Prototype.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include <Windows.h>
#include "Prototype.h"
#include "Person.h"
#include <vector>
using std::vector;
using std::cout;

int main()
{

	const int count = 999999;
	vector<Person2*> person2list;
	person2list.reserve( count );

	ULONGLONG preTime = GetTickCount64();
	for (int i = 0, max = count; i < max; i++)
	{
		person2list.push_back( new Person2() );
	}
	int useTime = GetTickCount64() - preTime;

	cout << "normal create use time:" << useTime << std::endl;




	vector<Person*> personlist;
	personlist.reserve( count );

	preTime = GetTickCount64();
	Person* proto = new Person;
	for (int i = 0, max = count - 1; i < max; i++)
	{
		personlist.push_back( proto->clone() );
	}
	useTime = GetTickCount64() - preTime;
	cout << "prototype create use time:" << useTime << std::endl;

	system( "echo.&pause" );
}